pkg_name=cairo
version=1.14.2
build_dir=$builds_dir_root/$pkg_name-$version
src_dir=$src_dir_root/$pkg_name-$version
url=http://cairographics.org/releases/$pkg_name-$version.tar.xz

cd "$src_dir_root"
rm -Rf "$pkg_name-$version"
tar Jxf "$pkg_name-$version.tar.xz"

rm -Rf "$build_dir"
mkdir -p "$build_dir"
cd "$build_dir"

#degenerated retards from gtk+ devs made mandatory the pdf, ps and backends
export CFLAGS=-O0
"$src_dir/configure"				\
	--prefix=/				\
	--disable-static			\
	--disable-gtk-doc			\
	--enable-largefile			\
	--enable-atomic 			\
	--disable-gcov				\
	--disable-valgrind			\
	--enable-xlib=yes			\
	--enable-xlib-xrender=yes		\
	--enable-xcb=yes			\
	--enable-xlib-xcb=yes			\
	--enable-xcb-shm=yes			\
	--disable-qt				\
	--disable-quartz			\
	--disable-quartz-font			\
	--disable-quartz-image			\
	--disable-win32				\
	--disable-win32-font			\
	--disable-skia				\
	--disable-os2				\
	--disable-beos				\
	--disable-drm				\
	--disable-gallium			\
	--enable-png=yes			\
	--disable-gl				\
	--disable-glesv2			\
	--disable-cogl				\
	--disable-directfb			\
	--disable-vg				\
	--disable-egl				\
	--disable-glx				\
	--disable-wgl				\
	--disable-script			\
	--enable-ft=yes				\
	--enable-fc=yes				\
	--enable-ps=yes				\
	--enable-pdf=yes			\
	--enable-svg=yes			\
	--disable-test-surfaces			\
	--disable-tee				\
	--disable-xml				\
	--enable-pthread=yes			\
	--enable-gobject=yes			\
	--disable-full-testing			\
	--disable-trace				\
	--disable-interpreter			\
	--disable-symbol-lookup			\
	--enable-some-floating-point=yes	\
	--with-gnu-ld
unset CFLAGS

make

install_tmp_dir=/tmp/$pkg_name-$version
rm -Rf "$install_tmp_dir"
mkdir -p "$install_tmp_dir"
make install "DESTDIR=$install_tmp_dir"

install_dirs "$builders_dir_root/$pkg_name/runtime.dirs"
install_files "$builders_dir_root/$pkg_name/runtime.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/runtime.links"
install_dirs "$builders_dir_root/$pkg_name/devel.dirs"
install_files "$builders_dir_root/$pkg_name/devel.files" "$install_tmp_dir"
install_links "$builders_dir_root/$pkg_name/devel.links"
elf_strip "$builders_dir_root/$pkg_name/elf-strip"

rm -Rf "$install_tmp_dir"
rm -Rf "$build_dir"
rm -Rf "$src_dir"
